/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javaapplication1;
import java.io.IOException;
import java.sql.SQLException;
import java.text.ParseException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.hyperic.sigar.SigarException;
import org.nsclient4j.NSClient4JException;

/**
 *
 * @author Jorge Ivan Cadavid
 */
public class Main {
    /**
     * @param args the command line arguments
     */
    public static boolean continuarMon;
    public static int ContadorRegistros;

    public static void main(String[] args) throws IOException, InterruptedException, SQLException, ParseException, SigarException, NSClient4JException, InstantiationException, IllegalAccessException
    {
        /*int mainCase = 0;
        if (args != null && !args[0].equals("")) {
            mainCase = Integer.parseInt(args[0]);
        }
        continuarMon=true;*/

        MonitorAgent monitor=new MonitorAgent();

        int mainCase=1;
        switch (mainCase)
        {
            case 0:
                System.out.println("Apagando Maquina");
                monitor.parameter=0;
                try {
                    monitor.TerminarMonitoreo(true);
                } catch (Throwable ex) {
                    Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                }
                System.exit(0);
                break;

            case 1:
                 System.out.println("Iniciando Maquina");
                 monitor.CargarDatosIniciales();
                 ContadorRegistros=0;
                 monitor.parameter=1;
                      while(true)
                      {
                          //IniciarMonitoreo(int frecuency, int registerFrecuency,boolean continuarMon)
                          monitor.IniciarMonitoreo(30, 5, continuarMon);
                      }
                      //break;

            case 2:
                 System.out.println("Login en la Maquina");
                 monitor.parameter=2;
                break;

            case 3:
                System.out.println("Logout en la Maquina");
                monitor.parameter=3;
                break;

            default:
                System.out.println("FATAL_ERROR_MESSAGE");
                System.exit(0);
        }
    }
}

